<template>
	<!-- 财务往来 -->
	<view class="box">
		<view :class="item.id==1?'card card1':item.id==2?'card card2':'card card3'" v-for="(item,index) in title"
			@click="goToLookDetail(item.yi,item.id)">
			<view class="smallFont">{{ item.yi }}</view>
			<view class="maxFont">{{item.money}}</view>
			<view class="public smallFont flexleft">
				<text>查看流水</text>
				<u-icon name="arrow-right" color="#fff" size="16"></u-icon>
			</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/commonFun/httpRequest.js");
	import conmon from '@/commonFun/conmon.js';
	export default {
		data() {
			return {
				title: [{
						yi: '欠款',
						money: "",
						id: 1
					},
					{
						yi: '余额',
						money: "",
						id: 2
					},
					// {yi: '订货款余额',money:"",id:3},
				],
			};
		},
		onLoad() {
			this.userMy();
		},
		methods: {
			userMy() {
				let _this = this
				httpRequest.request('/customapi/user/index', 'POST', {}).then(res => {
					if (res.code == 1) {
						this.title[0].money = res.data.qk_price
						this.title[1].money = res.data.money
					} else {
						httpRequest.toast(res.msg);
					}
				})
			},
			goToLookDetail(name, id) {
				uni.navigateTo({
					url: './lookDetail?title=' + name + '&id=' + id
				});
			}
		}
	};
</script>

<style scoped lang="scss">
	.box {
		padding: 20rpx;

		.card4 {
			// background-image: url('/static/Finance/Finance4.png') !important;
		}


		.card2 {
			background-image: url('/static/Finance/Finance2.png') !important;
		}

		.card1 {
			background-image: url('/static/Finance/Finance1.png');
		}

		.card {
			padding: 20rpx;
			background-size: 100%;
			flex-direction: column;
			display: flex;
			justify-content: space-between;
			height: 230rpx;
			background-repeat: no-repeat;
			color: #ffffff;
			margin-bottom: 20rpx;

			.public {
				align-items: center;

				image {
					width: 28rpx;
					height: 28rpx;
					margin-left: 10rpx;
				}
			}
		}
	}

	.smallFont {
		font-size: 36rpx;
	}

	.maxFont {
		font-weight: 900;
		font-size: 40rpx;
	}
</style>